home *** CD-ROM | disk | FTP | other *** search
- { inandout.pas -- Demonstrate DLL entry and exit code }
-
- library InAndOut;
-
- uses WinTypes, WinProcs;
-
- const
-
- caption = 'InAndOut DLL'; { Caption for message box }
-
- var
-
- Chain: Pointer; { Exit chain pointer }
-
- {$S-} { Stack checking must be off for exit procedures }
-
- {- DLL exit procedure. Runs when DLL is unloaded }
- procedure DLLExitProc; far;
- begin
- if ExitCode = wep_Free_DLL then
- begin
- { Perform any DLL shutdown chores here }
- MessageBox(0, 'Unloading library', caption,
- mb_TaskModal or mb_Ok);
- end else
- begin
- { System is shutting down }
- end;
- ExitProc := Chain
- end;
-
- begin
- MessageBox(0, 'Loading library', caption,
- mb_TaskModal or mb_Ok);
- Chain := ExitProc;
- ExitProc := @DLLExitProc
- end.
-
-
- {--------------------------------------------------------------
- Copyright (c) 1991 by Tom Swan. All rights reserved.
- Revision 1.00 Date: 5/25/1991
- ---------------------------------------------------------------}
-